package tests;

import com.sun.javaws.IconUtil;

import java.util.Scanner;
//   收件人列表
public class test21 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int n = sc.nextInt();
            sc.nextLine();
            for(int i = 0;i < n;i++){
                String name = sc.nextLine();
                if(name.contains(",")||name.contains(" ")){
                    System.out.print("\""+name+"\"");//\"
                }else{
                    System.out.print(name);
                }
                if(i!=n-1){
                    System.out.print(", ");
                }
            }
            System.out.println();
        }
    }
}
